<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '图文列表';
?>
<div class="wecaht-newsindex">
    <h1><?= Html::encode($this->title) ?></h1>
    <p>
        <?= Html::a('首页', ['/member/index'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $model,
        'columns' => [
            'id',
            'msg_data_id',
            [
                'label'=>'创建日期',
                'attribute' => 'updatetime',
                'value' => function($dataProvider) {
                       return date('Y-m-d H:i:s',$dataProvider->updatetime); }
            ],
            ['class' => 'yii\grid\ActionColumn','header'=>'操作','template' => '{details} ',
                'buttons' => [
                'details' => function ($url, $model, $key) {
                    return  Html::a('<span class="glyphicon glyphicon-plus  btn btn-success btn-sm"></span>', $url, ['title' => '查看图文详情'] ) ;
                    },
                ],
           'headerOptions' => ['width' => '180']
            ],          
        ],
    ]); ?>
</div>
